const systemInfo = uni.getSystemInfoSync()

// 状态栏高度
export const getStatusBarHeight = () => systemInfo.statusBarHeight || 0

// 胶囊高度
export const getTitleBarHeight = () => {
	if (uni.getMenuButtonBoundingClientRect) {
		const { top, height } = uni.getMenuButtonBoundingClientRect()
		return (top - getStatusBarHeight()) * 2 + height
	}
	return 40
}
// 胶囊顶部间距
export const getMenuButtonTop = () => {
	if (uni.getMenuButtonBoundingClientRect) {
		const { top } = uni.getMenuButtonBoundingClientRect()
		return top - getStatusBarHeight()
	}
	return 0
}

// navbar总高度
export const getNavBarHeight = () => getStatusBarHeight() + getTitleBarHeight()